package com.pxr.oop.extendsdemo;

public class Person {
    //属性
    private String perName;
    private int perAge;
    private String perSex;

    //行为
    public Person() {
        System.out.println("执行Person类默认的构造方法");
    }

    public Person(String perName,int perAge,String perSex) {
        this.perName = perName;
        this.perAge = perAge;
        this.perSex = perSex;
        System.out.println("执行Person类自定义的构造方法");
    }

    public String getPerName() {
        return perName;
    }

    public void setPerName(String perName) {
        this.perName = perName;
    }

    public int getPerAge() {
        return perAge;
    }

    public void setPerAge(int perAge) {
        this.perAge = perAge;
    }

    public String getPerSex() {
        return perSex;
    }

    public void setPerSex(String perSex) {
        this.perSex = perSex;
    }

    /**
     * 吃饭行为
     */
    public void doEating() {
        System.out.println("I am eating....");
    }

    /**
     * 学习行为
     */
    public void doStudying() {
        System.out.println("I am studying...");
    }
}
